<script setup lang="ts">
import { ref, reactive, onMounted } from 'vue'
import { aesUtil } from '@/Utils/ase'

const data = reactive({
  text: '',
  text2: '',
  result: '',
})

const key = ''

// 加密
const encrypt = () => {
  data.result = aesUtil.encrypt(data.text, key)
}
// 解密
const decrypt = () => {
  data.result = aesUtil.decrypt(data.text2, key)
}
</script>

<template>
  <div>
    <TitleCom> 这里是(5月)标记 </TitleCom>
    <h1>加密</h1>
    <input type="text" v-model="data.text" />
    <button @click="encrypt">加密</button>
    <h1>解密</h1>
    <input type="text" v-model="data.text2" />
    <button @click="decrypt">解密</button>
    <h1>结果</h1>
    <p>{{ decodeURIComponent(data.result) }}</p>
  </div>
</template>
